## setup ##

# clean environment
rm(list=ls())

# load packages
library(sandwich)
library(lmtest)

# load data
dat <- read.csv2("data_experiment_outcomes_csv.csv",
                 encoding = 'UTF-8')

# outcome variable to numeric
dat$response <- as.numeric(as.character(dat$response))


## models

# column 1
mod_1<-lm(response~yusuf, dat[dat$yusuf==1 | (dat$yusuf==0 & dat$kemal==0),])

# column 3
mod_3<-lm(response~kemal, dat[dat$kemal==1 | (dat$yusuf==0 & dat$kemal==0),])


## robust standard errors

# column 1
mod_1_rob <- coeftest(mod_1, vcov = vcovHC(mod_1, "HC1"))

# column 3
mod_3_rob <- coeftest(mod_3, vcov = vcovHC(mod_3, "HC1"))


## show coefficients and standard errors
mod_1_rob
mod_3_rob
